package five_class_design_creational_patterns.two_simpleFactory;

/**
 * @author 北巷_东坡
 * @date 2022/10/15 15:07
 * @computer 10741
 */
public class Nvwa206 {
    public static Person206 MakePerson(String person206) throws Exception{
        if (person206.equalsIgnoreCase("Man206")){
            System.out.println("女娲造了一个男人");
            return new Man206();
        }
        else if (person206.equalsIgnoreCase("Woman206")){
            System.out.println("女娲造了一个女人");
            return new Woman206();
        }
        else if (person206.equalsIgnoreCase("Robot206")){
            System.out.println("女娲造了一个机器人");
            return new Robot206();
        }else {
            throw new Exception("对不起，女娲暂时不能造其他东西");
        }
    }
}
